/*
 * $Id: BasicLogger.java 94 2013-01-10 14:03:20Z vladimirow@mail.ru $
 * $HeadURL: http://ultralog.googlecode.com/svn/ultralog/trunk/src/java/com/google/code/ultralog/BasicLogger.java $
 *
 * This file is a part of ultralog project (http://code.google.com/p/ultralog/).
 * Released under New BSD License.
 */
package com.google.code.ultralog;

/**
 * Defines basic logging levels.
 *
 * @author Mikhail Vladimirov
 */
public interface BasicLogger extends Logger
{
    /**
     * Trace logging level ({@value #TRACE}).  This logging level is for events
     * that could happen very often.
     */
    @LogLevel
    public final static int TRACE = 1000;

    /**
     * Debug logging level ({@value #DEBUG}).  This logging level is for
     * low-level events that are meaningful for developers but not for end
     * users.
     */
    @LogLevel
    public final static int DEBUG = 2000;

    /**
     * Info logging level ({@link #INFO}).  This logging level is for events
     * that are meaningful for end user.
     */
    @LogLevel
    public final static int INFO = 3000;

    /**
     * Waning logging level ({@value #WARNING}).  This logging level is for
     * problems the application can automatically recover from.
     */
    @LogLevel
    public final static int WARNING = 4000;

    /**
     * Error logging level ({@value #ERROR}).  This logging level is for severe
     * problems the application cannot automatically recover from.
     */
    @LogLevel
    public final static int ERROR = 5000;

    /**
     * Tells whether trace logging level is enabled for this logger.
     *
     * @return <code>true</code> if trace logging level is enabled,
     *         <code>false</code> otherwise
     */
    @LogLevelChecker (level = TRACE)
    public boolean isTraceEnabled ();

    /**
     * Tells whether debug logging level is enabled for this logger.
     *
     * @return <code>true</code> if debug logging level is enabled,
     *         <code>false</code> otherwise
     */
    @LogLevelChecker (level = DEBUG)
    public boolean isDebugEnabled ();

    /**
     * Tells whether info logging level is enabled for this logger.
     *
     * @return <code>true</code> if info logging level is enabled,
     *         <code>false</code> otherwise
     */
    @LogLevelChecker (level = INFO)
    public boolean isInfoEnabled ();

    /**
     * Tells whether warning logging level is enabled for this logger.
     *
     * @return <code>true</code> if warning logging level is enabled,
     *         <code>false</code> otherwise
     */
    @LogLevelChecker (level = WARNING)
    public boolean isWarningEnabled ();

    /**
     * Tells whether error logging level is enabled for this logger.
     *
     * @return <code>true</code> if error logging level is enabled,
     *         <code>false</code> otherwise
     */
    @LogLevelChecker (level = ERROR)
    public boolean isErrorEnabled ();

    /**
     * Generic trace level log message.
     *
     * @param message message to be logged
     */
    @LogMessage (level = TRACE, template = "${1}")
    public void trace (String message);

    /**
     * Generic debug level log message.
     *
     * @param message message to be logged
     */
    @LogMessage (level = DEBUG, template = "${1}")
    public void debug (String message);

    /**
     * Generic info level log message.
     *
     * @param message message to be logged
     */
    @LogMessage (level = INFO, template = "${1}")
    public void info (String message);

    /**
     * Generic warning level log message.
     *
     * @param message message to be logged
     */
    @LogMessage (level = WARNING, template = "${1}")
    public void warning (String message);

    /**
     * Generic warning level log message with throwable attached.
     *
     * @param message message to be logged
     * @param ex throwable attached to the message
     */
    @LogMessage (level = WARNING, template = "${1}\n${2}")
    public void warning (String message, Throwable ex);

    /**
     * Generic error level log message with throwable attached.
     *
     * @param message message to be logged
     * @param ex throwable attached to the message
     */
    @LogMessage (level = ERROR, template = "${1}\n${2}")
    public void error (String message, Throwable ex);
}
